Skip to content

Conversation

@markelov208
Copy link
Contributor

@markelov208 markelov208 commented Dec 18, 2025

📝 Description
A brief description of the PR.

  • split hpp files into header and cpp files
  • renamed some headers into hpp if they include template functions

@markelov208 markelov208 self-assigned this Dec 18, 2025
@markelov208 markelov208 requested a review from a team as a code owner December 18, 2025 12:44
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the efforts of splitting classes into header + source, improving the 'include health' in a lot of these classes and also making the changes in a way that makes diffing as easy as possible (i.e. you kept the same order in the functions, that's much appreciated 😄 ).

I didn't do an in-depth review of all code, but mainly checked it stayed the same and all implementations were moved out of the headers. I only have a few minor comments about forward declares, includes and some left-over implementations in .h files.

{

class Model;
class Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the forward declare does work, because the Parameters are passed as reference 👍

Comment on lines 108 to 116
/// output stream function
inline std::ostream& operator<<(std::ostream& rOStream, const ApplyConstantInterpolateLinePressureProcess& rThis)
{
rThis.PrintInfo(rOStream);
rOStream << std::endl;
rThis.PrintData(rOStream);

return rOStream;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this also be moved to the cpp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is possible but then it could not be inline, right? As far as I remember a compiler makes a decision and it can ignore inline statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed these operators. Once Anne asked to remove such lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also a solution, fine with me!

@markelov208 markelov208 requested a review from rfaasse January 15, 2026 22:19
Copy link
Contributor

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for processing the review comments. I only have a single suggestion, that you should ignore, unless there are some other changes you'd also like to do. Ready to go from my side!

Comment on lines 42 to 45
/// Execute method is used to execute the ApplyWriteScalarProcess algorithms.
void Execute() override;
void Execute() override {
// to avoid using the base class function
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Execute method of the base is also just an empty function, so I don't think we need to override it, we could just remove the function. It's not enough to block the PR for though, so please only do it if there's something else you'd like to change as well.

for (unsigned int j = 0; j < BoundaryNodes.size(); ++j) {
if (Id == BoundaryNodes[j]) {
mBoundaryNodes[iPosition++] = &rNode;
const auto Id = static_cast<int>(rNode.Id());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think the static casts are fine. However, I think in the longer term, it would be a good idea to just make sure everything in this class is in terms of std::size_t, since the Id() functions return this. But that's out of scope of this PR and probably also needs to be discussed with others, so let's leave it for now (same for the other casts in this file)

ElementIDs[iPoint][i] = iElementID;
}
}
constexpr int ID_UNDEFINED = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope for this PR (and of course it was already there), but working like this with 'undefined ids' should really be avoided. We can refactor this later (first adding unit tests, then making changes)

<< "No boundary node is found for interpolate line pressure process" << std::endl;
}

bool ApplyConstantInterpolateLinePressureProcess::IsMoreThanOneElementWithThisEdgeFast(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring this function slightly, such that the complexity is lower. I think it can be simplified even more, but that's out of scope of this PR. For that I'd like to first add unit tests and then start simplifying (and seeing how small +clear we could get this code).

That's for later, thanks for the efforts here!

Comment on lines 108 to 116
/// output stream function
inline std::ostream& operator<<(std::ostream& rOStream, const ApplyConstantInterpolateLinePressureProcess& rThis)
{
rThis.PrintInfo(rOStream);
rOStream << std::endl;
rThis.PrintData(rOStream);

return rOStream;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also a solution, fine with me!

@markelov208
Copy link
Contributor Author

Hi Richard, many thanks for the review and comments. They are in Kratos Product Backlog (view) for future work.

@markelov208 markelov208 merged commit 1db7fd0 into master Jan 16, 2026
9 of 10 checks passed
@markelov208 markelov208 deleted the geo/14046-move-non-template-code-from-h-to-cpp-processes branch January 16, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GeoMechanicsApplication] Move all non-template code to .cpp files and make sure any .h file does not contain any implementations

3 participants